package com.xjh.uitl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JDBCUtil {
    private static final String URL = "jdbc:mysql://localhost:3306/studentsystem";
    private final String NAME="root";
    private final String PWD="123456";
    Connection conn=null;




    public JDBCUtil() throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        conn= DriverManager.getConnection(URL,NAME,PWD);
    }

    public static JDBCUtil JDBCUtil() throws SQLException, ClassNotFoundException {
        return new JDBCUtil();
    }
        public  Connection getConn() throws SQLException, ClassNotFoundException {
        return this.conn;
    }













}
